<template>
  <!-- 赠券方案详情组件 -->
  <zm-panel :visible.sync="value" title="详情" @change="closeAfter" class="panelContainer">
    <app-block class="mb15 optionBtn">
      <div>
        <h3>类型为{{obj.typeDes}}转赠方案名称</h3>
        <zm-button plain @click="toEdit" t="submit" custtxt="修改"></zm-button>
      </div>
    </app-block>
    <app-block>
      <el-tabs v-model="form.tabType" @tab-click="tabChange" class="wp100 vm">
        <el-tab-pane :label="item.label" :name="item.value" v-for="(item, index) in OPERATE_TAB" :key="index" />
      </el-tabs>
      <component :is="form.tabType" :obj="obj" :id="id"></component>
    </app-block>
    <div slot="footer" class="tr">
    </div>
  </zm-panel>
</template>

<script>
import panelMixin from '@/mixins/panelMixin'
import { OPERATE_TAB } from '../detail/components/const'
import BasicInformation from '../detail/components/BasicInformation'
import AssociatedSalesOrder from '../detail/components/associatedSalesOrder/index.vue'

import NewPanel from '../New'
import {checkHasOrder, deleteCheck
  , checkReceivePublic
  , receivePublic} from '@/api/src/customer'

export default {
  name: 'DetailCustomer',
  components: {
    BasicInformation,
    AssociatedSalesOrder
  },
  mixins: [panelMixin],
  props: {
    obj: {
      type: Object,
      default: () => {
        return {}
      }
    },
    id: {
      type: String,
      required: true
    }
  },
  data () {
    return {
      OPERATE_TAB,
      form: {
        tabType: 'basicInformation'
      }
    }
  },
  computed: {
  },
  created () {
  },
  methods: {
    toEdit () {
      this.$emit('toEdit', this.obj)
    },
    tabChange () {

    },
    closeAfter () {
      this.close()
      this.$emit('load-list')
    }
  }
}
</script>

<style>
</style>
